home *** CD-ROM | disk | FTP | other *** search
open in:
MacOS 8.1
|
Win98
|
DOS
browse contents |
view JSON data
|
view as text
This file was processed as: Mailbox/MIME Entity
(archive/mbox).
Confidence | Program | Detection | Match Type | Support
|
---|
100%
| dexvert
| Newsgroup Content (archive/news)
| magic
| Supported |
100%
| dexvert
| Mailbox/MIME Entity (archive/mbox)
| magic
| Supported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| news text
| default
| |
99%
| file
| C++ source text
| default
| |
98%
| file
| C source text
| default
| |
97%
| file
| C source, ASCII text
| default
| |
100%
| checkBytes
| Printable ASCII
| default
| |
100%
| dexmagic
| PrintFox/Pagefox WEAK
| default
| |
100%
| perlTextCheck
| Likely Text (Perl)
| default
| |
100%
| siegfried
| fmt/950 MIME Email (1.0)
| default
| |
100%
| detectItEasy
| Format: plain text[LF]
| default (weak)
| |
100%
| xdgMime
| message/news
| default
|
|
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 50 61 74 68 3a 20 74 75 | 64 65 6c 66 74 2e 6e 6c |Path: tu|delft.nl|
|00000010| 21 6e 65 77 73 0a 46 72 | 6f 6d 3a 20 45 6a 6f 20 |!news.Fr|om: Ejo |
|00000020| 53 63 68 72 61 6d 61 20 | 3c 73 63 68 72 61 6d 61 |Schrama |<schrama|
|00000030| 40 67 65 6f 2e 74 75 64 | 65 6c 66 74 2e 6e 6c 3e |@geo.tud|elft.nl>|
|00000040| 0a 4e 65 77 73 67 72 6f | 75 70 73 3a 20 63 6f 6d |.Newsgro|ups: com|
|00000050| 70 2e 6c 61 6e 67 2e 63 | 2b 2b 0a 53 75 62 6a 65 |p.lang.c|++.Subje|
|00000060| 63 74 3a 20 52 65 3a 20 | 43 61 6e 20 73 6f 6d 65 |ct: Re: |Can some|
|00000070| 62 6f 64 79 20 65 78 70 | 6c 61 69 6e 20 6d 65 20 |body exp|lain me |
|00000080| 68 6f 77 20 74 6f 20 64 | 6f 20 74 68 69 73 20 69 |how to d|o this i|
|00000090| 6e 20 43 2b 2b 0a 44 61 | 74 65 3a 20 37 20 4d 61 |n C++.Da|te: 7 Ma|
|000000a0| 72 20 31 39 39 36 20 30 | 39 3a 30 38 3a 33 34 20 |r 1996 0|9:08:34 |
|000000b0| 47 4d 54 0a 4f 72 67 61 | 6e 69 7a 61 74 69 6f 6e |GMT.Orga|nization|
|000000c0| 3a 20 54 55 20 44 65 6c | 66 74 2c 20 46 61 63 75 |: TU Del|ft, Facu|
|000000d0| 6c 74 79 20 6f 66 20 47 | 65 6f 64 65 74 69 63 20 |lty of G|eodetic |
|000000e0| 45 6e 67 69 6e 65 65 72 | 69 6e 67 0a 4d 65 73 73 |Engineer|ing.Mess|
|000000f0| 61 67 65 2d 49 44 3a 20 | 3c 34 68 6d 39 32 69 24 |age-ID: |<4hm92i$|
|00000100| 35 63 6b 40 6d 6f 36 2e | 72 63 2e 74 75 64 65 6c |5ck@mo6.|rc.tudel|
|00000110| 66 74 2e 6e 6c 3e 0a 52 | 65 66 65 72 65 6e 63 65 |ft.nl>.R|eference|
|00000120| 73 3a 20 3c 34 68 6b 62 | 32 6f 24 6b 6f 33 40 6d |s: <4hkb|2o$ko3@m|
|00000130| 6f 36 2e 72 63 2e 74 75 | 64 65 6c 66 74 2e 6e 6c |o6.rc.tu|delft.nl|
|00000140| 3e 20 3c 34 68 6c 73 36 | 36 24 36 6a 67 40 73 61 |> <4hls6|6$6jg@sa|
|00000150| 6d 2e 69 6e 66 6f 72 61 | 6d 70 2e 6e 65 74 3e 0a |m.infora|mp.net>.|
|00000160| 4e 4e 54 50 2d 50 6f 73 | 74 69 6e 67 2d 48 6f 73 |NNTP-Pos|ting-Hos|
|00000170| 74 3a 20 64 75 74 67 73 | 37 2e 67 65 6f 2e 74 75 |t: dutgs|7.geo.tu|
|00000180| 64 65 6c 66 74 2e 6e 6c | 0a 4d 69 6d 65 2d 56 65 |delft.nl|.Mime-Ve|
|00000190| 72 73 69 6f 6e 3a 20 31 | 2e 30 0a 43 6f 6e 74 65 |rsion: 1|.0.Conte|
|000001a0| 6e 74 2d 54 79 70 65 3a | 20 6d 75 6c 74 69 70 61 |nt-Type:| multipa|
|000001b0| 72 74 2f 6d 69 78 65 64 | 3b 0a 09 62 6f 75 6e 64 |rt/mixed|;..bound|
|000001c0| 61 72 79 3d 22 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |ary="---|--------|
|000001d0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000001e0| 2d 2d 2d 2d 31 35 32 37 | 32 32 36 30 34 38 31 39 |----1527|22604819|
|000001f0| 38 38 31 22 0a 58 2d 4d | 61 69 6c 65 72 3a 20 4d |881".X-M|ailer: M|
|00000200| 6f 7a 69 6c 6c 61 20 31 | 2e 31 32 20 28 58 31 31 |ozilla 1|.12 (X11|
|00000210| 3b 20 49 3b 20 48 50 2d | 55 58 20 41 2e 30 39 2e |; I; HP-|UX A.09.|
|00000220| 30 35 20 39 30 30 30 2f | 37 33 35 29 0a 54 6f 3a |05 9000/|735).To:|
|00000230| 20 72 6d 6f 72 69 6e 40 | 69 6e 66 6f 72 61 6d 70 | rmorin@|inforamp|
|00000240| 2e 6e 65 74 0a 58 2d 55 | 52 4c 3a 20 66 69 6c 65 |.net.X-U|RL: file|
|00000250| 3a 2f 75 73 65 72 73 2f | 73 63 68 72 61 6d 61 2f |:/users/|schrama/|
|00000260| 70 72 6f 62 6c 65 6d 2e | 63 63 0a 0a 54 68 69 73 |problem.|cc..This|
|00000270| 20 69 73 20 61 20 6d 75 | 6c 74 69 2d 70 61 72 74 | is a mu|lti-part|
|00000280| 20 6d 65 73 73 61 67 65 | 20 69 6e 20 4d 49 4d 45 | message| in MIME|
|00000290| 20 66 6f 72 6d 61 74 2e | 0a 0a 2d 2d 2d 2d 2d 2d | format.|..------|
|000002a0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000002b0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 31 35 32 37 32 |--------|---15272|
|000002c0| 32 36 30 34 38 31 39 38 | 38 31 0a 43 6f 6e 74 65 |26048198|81.Conte|
|000002d0| 6e 74 2d 54 72 61 6e 73 | 66 65 72 2d 45 6e 63 6f |nt-Trans|fer-Enco|
|000002e0| 64 69 6e 67 3a 20 37 62 | 69 74 0a 43 6f 6e 74 65 |ding: 7b|it.Conte|
|000002f0| 6e 74 2d 54 79 70 65 3a | 20 74 65 78 74 2f 70 6c |nt-Type:| text/pl|
|00000300| 61 69 6e 3b 20 63 68 61 | 72 73 65 74 3d 75 73 2d |ain; cha|rset=us-|
|00000310| 61 73 63 69 69 0a 0a 72 | 6d 6f 72 69 6e 40 69 6e |ascii..r|morin@in|
|00000320| 66 6f 72 61 6d 70 2e 6e | 65 74 20 28 52 61 6e 64 |foramp.n|et (Rand|
|00000330| 79 20 43 68 61 72 6c 65 | 73 20 4d 6f 72 69 6e 29 |y Charle|s Morin)|
|00000340| 20 77 72 6f 74 65 3a 0a | 3e 49 6e 20 61 72 74 69 | wrote:.|>In arti|
|00000350| 63 6c 65 20 3c 34 68 6b | 62 32 6f 24 6b 6f 33 40 |cle <4hk|b2o$ko3@|
|00000360| 6d 6f 36 2e 72 63 2e 74 | 75 64 65 6c 66 74 2e 6e |mo6.rc.t|udelft.n|
|00000370| 6c 3e 2c 0a 3e 20 20 20 | 45 6a 6f 20 53 63 68 72 |l>,.> |Ejo Schr|
|00000380| 61 6d 61 20 3c 73 63 68 | 72 61 6d 61 40 67 65 6f |ama <sch|rama@geo|
|00000390| 2e 74 75 64 65 6c 66 74 | 2e 6e 6c 3e 20 77 72 6f |.tudelft|.nl> wro|
|000003a0| 74 65 3a 0a 3e 3e 20 20 | 20 20 6c 6f 63 61 6c 70 |te:.>> | localp|
|000003b0| 6f 69 6e 74 65 72 32 2d | 3e 65 78 65 63 75 74 65 |ointer2-|>execute|
|000003c0| 5f 72 6f 75 74 69 6e 65 | 28 29 3b 0a 3e 0a 3e 41 |_routine|();.>.>A|
|000003d0| 73 20 6c 6f 6e 67 20 61 | 73 20 6c 6f 63 61 6c 70 |s long a|s localp|
|000003e0| 6f 69 6e 74 65 72 32 20 | 69 73 20 72 65 61 6c 6c |ointer2 |is reall|
|000003f0| 79 20 70 6f 69 6e 74 69 | 6e 67 20 74 6f 20 61 20 |y pointi|ng to a |
|00000400| 43 70 61 72 61 6d 5f 69 | 6e 68 65 72 65 74 65 64 |Cparam_i|nhereted|
|00000410| 5f 6d 65 74 68 6f 64 2c | 20 74 68 65 6e 20 0a 3e |_method,| then .>|
|00000420| 49 20 64 6f 6e 27 74 20 | 73 65 65 20 77 68 79 20 |I don't |see why |
|00000430| 69 74 20 77 6f 75 6c 64 | 20 66 61 69 6c 2e 20 20 |it would| fail. |
|00000440| 49 74 20 77 6f 75 6c 64 | 20 66 61 69 6c 20 69 66 |It would| fail if|
|00000450| 20 79 6f 75 20 68 61 64 | 20 61 20 0a 3e 43 70 61 | you had| a .>Cpa|
|00000460| 72 61 6d 5f 69 6e 68 65 | 72 65 74 65 64 5f 6d 65 |ram_inhe|reted_me|
|00000470| 74 68 6f 64 32 20 74 68 | 61 74 20 77 61 73 20 64 |thod2 th|at was d|
|00000480| 65 72 69 76 65 64 20 66 | 72 6f 6d 20 43 70 61 72 |erived f|rom Cpar|
|00000490| 61 6d 20 61 6e 64 20 61 | 73 73 69 67 6e 65 64 20 |am and a|ssigned |
|000004a0| 74 6f 20 0a 3e 6c 6f 63 | 61 6c 70 6f 69 6e 74 65 |to .>loc|alpointe|
|000004b0| 72 32 2e 20 20 42 75 74 | 20 61 73 20 6c 6f 6e 67 |r2. But| as long|
|000004c0| 20 61 73 20 79 6f 75 20 | 61 72 65 20 63 61 72 65 | as you |are care|
|000004d0| 66 75 6c 2c 20 79 6f 75 | 20 73 68 6f 75 6c 64 6e |ful, you| shouldn|
|000004e0| 27 74 20 68 61 76 65 20 | 61 20 70 72 6f 62 6c 65 |'t have |a proble|
|000004f0| 6d 2e 20 0a 3e 20 44 69 | 64 20 49 20 6d 69 73 73 |m. .> Di|d I miss|
|00000500| 20 73 6f 6d 65 74 68 69 | 6e 67 3f 20 20 4f 66 20 | somethi|ng? Of |
|00000510| 63 6f 75 72 73 65 2c 20 | 49 27 76 65 20 62 65 65 |course, |I've bee|
|00000520| 6e 20 6b 6e 6f 77 6e 20 | 74 6f 20 62 65 20 77 72 |n known |to be wr|
|00000530| 6f 6e 67 2e 20 20 57 68 | 69 63 68 20 0a 3e 63 6f |ong. Wh|ich .>co|
|00000540| 6d 70 69 6c 65 72 20 61 | 72 65 20 79 6f 75 20 75 |mpiler a|re you u|
|00000550| 73 69 6e 67 3f 20 20 49 | 27 6c 6c 20 74 72 79 20 |sing? I|'ll try |
|00000560| 73 6f 6d 65 20 65 78 61 | 6d 70 6c 65 73 20 69 66 |some exa|mples if|
|00000570| 20 79 6f 75 20 67 65 74 | 20 62 61 63 6b 20 74 6f | you get| back to|
|00000580| 20 6d 65 2e 0a 3e 0a 3e | 41 67 72 69 76 61 72 0a | me..>.>|Agrivar.|
|00000590| 0a 0a 4d 61 79 62 65 20 | 49 20 64 69 64 6e 27 74 |..Maybe |I didn't|
|000005a0| 20 6d 61 6b 65 20 6d 79 | 73 65 6c 66 20 63 6c 65 | make my|self cle|
|000005b0| 61 72 20 69 6e 20 74 68 | 65 20 64 69 73 63 75 73 |ar in th|e discus|
|000005c0| 73 69 6f 6e 20 6f 66 0a | 74 68 65 20 70 72 6f 62 |sion of.|the prob|
|000005d0| 6c 65 6d 2e 20 46 69 6e | 64 20 69 6e 63 6c 75 64 |lem. Fin|d includ|
|000005e0| 65 64 20 74 68 65 20 73 | 61 6d 70 6c 65 20 70 72 |ed the s|ample pr|
|000005f0| 6f 67 72 61 6d 20 61 6e | 64 20 6c 6f 6f 6b 0a 61 |ogram an|d look.a|
|00000600| 74 20 74 68 65 20 65 72 | 72 6f 72 20 6d 65 73 73 |t the er|ror mess|
|00000610| 61 67 65 73 20 74 68 61 | 74 20 79 6f 75 20 67 65 |ages tha|t you ge|
|00000620| 74 20 64 75 72 69 6e 67 | 20 63 6f 6d 70 69 6c 61 |t during| compila|
|00000630| 74 69 6f 6e 2e 0a 52 65 | 6d 65 6d 62 65 72 20 74 |tion..Re|member t|
|00000640| 68 61 74 20 49 20 6f 6e | 6c 79 20 77 61 6e 74 20 |hat I on|ly want |
|00000650| 74 6f 20 75 73 65 20 61 | 72 72 61 79 5b 69 5d 20 |to use a|rray[i] |
|00000660| 65 6c 65 6d 65 6e 74 73 | 20 61 73 20 0a 61 20 70 |elements| as .a p|
|00000670| 6f 69 6e 74 20 6f 66 20 | 72 65 66 65 72 65 6e 63 |oint of |referenc|
|00000680| 65 20 69 6e 20 61 20 6c | 61 72 67 65 20 70 72 6f |e in a l|arge pro|
|00000690| 67 72 61 6d 2e 20 49 6e | 20 64 6f 69 6e 67 20 73 |gram. In| doing s|
|000006a0| 6f 20 0a 74 68 65 72 65 | 20 69 73 20 6e 6f 20 77 |o .there| is no w|
|000006b0| 61 79 20 74 6f 20 67 65 | 74 20 61 63 63 65 73 73 |ay to ge|t access|
|000006c0| 20 74 6f 20 76 61 6c 75 | 65 33 20 69 6e 20 43 69 | to valu|e3 in Ci|
|000006d0| 6e 68 65 72 65 74 65 64 | 63 6c 61 73 73 20 0a 61 |nhereted|class .a|
|000006e0| 6e 64 20 6d 79 20 6f 6e | 6c 79 20 6f 70 74 69 6f |nd my on|ly optio|
|000006f0| 6e 73 20 73 65 65 6d 20 | 74 6f 20 62 65 20 74 6f |ns seem |to be to|
|00000700| 20 69 6e 74 72 6f 64 75 | 63 65 20 76 61 6c 75 65 | introdu|ce value|
|00000710| 33 20 69 6e 20 0a 74 68 | 65 20 62 61 73 65 63 6c |3 in .th|e basecl|
|00000720| 61 73 73 20 6f 72 20 74 | 6f 20 6b 65 65 70 20 61 |ass or t|o keep a|
|00000730| 20 64 6f 75 62 6c 65 20 | 61 64 6d 69 6e 69 73 74 | double |administ|
|00000740| 61 74 69 6f 6e 20 6f 66 | 20 0a 43 69 6e 68 65 72 |ation of| .Cinher|
|00000750| 65 74 65 64 63 6c 61 73 | 73 20 61 6e 64 20 43 62 |etedclas|s and Cb|
|00000760| 61 73 65 63 6c 61 73 73 | 20 70 6f 69 6e 74 65 72 |aseclass| pointer|
|00000770| 73 2e 20 46 6f 72 20 62 | 69 67 67 65 72 20 63 6c |s. For b|igger cl|
|00000780| 61 73 73 65 73 0a 62 6f | 74 68 20 6f 70 74 69 6f |asses.bo|th optio|
|00000790| 6e 73 20 61 72 65 20 61 | 20 6e 75 69 73 61 6e 63 |ns are a| nuisanc|
|000007a0| 65 20 74 68 61 74 20 49 | 20 77 61 6e 74 20 74 6f |e that I| want to|
|000007b0| 20 61 76 6f 69 64 2e 20 | 53 6f 20 49 27 6d 0a 6f | avoid. |So I'm.o|
|000007c0| 70 65 6e 20 74 6f 20 73 | 75 67 67 65 73 74 69 6f |pen to s|uggestio|
|000007d0| 6e 73 20 74 68 61 74 20 | 49 20 68 61 76 65 6e 27 |ns that |I haven'|
|000007e0| 74 20 74 68 6f 75 67 68 | 74 20 6f 66 20 79 65 74 |t though|t of yet|
|000007f0| 2e 0a 0a 45 6a 6f 0a 0a | 2d 2d 2d 2d 2d 2d 2d 2d |...Ejo..|--------|
|00000800| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000810| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 31 35 32 37 32 32 36 |--------|-1527226|
|00000820| 30 34 38 31 39 38 38 31 | 0a 43 6f 6e 74 65 6e 74 |04819881|.Content|
|00000830| 2d 54 72 61 6e 73 66 65 | 72 2d 45 6e 63 6f 64 69 |-Transfe|r-Encodi|
|00000840| 6e 67 3a 20 37 62 69 74 | 0a 43 6f 6e 74 65 6e 74 |ng: 7bit|.Content|
|00000850| 2d 54 79 70 65 3a 20 74 | 65 78 74 2f 70 6c 61 69 |-Type: t|ext/plai|
|00000860| 6e 0a 0a 23 69 6e 63 6c | 75 64 65 20 3c 73 74 64 |n..#incl|ude <std|
|00000870| 69 6f 2e 68 3e 0a 0a 63 | 6c 61 73 73 20 43 62 61 |io.h>..c|lass Cba|
|00000880| 73 65 63 6c 61 73 73 20 | 7b 0a 20 20 70 72 6f 74 |seclass |{. prot|
|00000890| 65 63 74 65 64 3a 0a 20 | 20 20 20 66 6c 6f 61 74 |ected:. | float|
|000008a0| 20 76 61 6c 75 65 31 3b | 0a 20 20 70 75 62 6c 69 | value1;|. publi|
|000008b0| 63 3a 0a 20 20 20 20 43 | 62 61 73 65 63 6c 61 73 |c:. C|baseclas|
|000008c0| 73 28 20 66 6c 6f 61 74 | 20 69 6e 70 75 74 20 29 |s( float| input )|
|000008d0| 20 7b 20 76 61 6c 75 65 | 31 20 3d 20 69 6e 70 75 | { value|1 = inpu|
|000008e0| 74 3b 20 7d 0a 20 20 20 | 20 76 6f 69 64 20 73 68 |t; }. | void sh|
|000008f0| 6f 77 6f 6e 65 28 29 20 | 7b 20 70 72 69 6e 74 66 |owone() |{ printf|
|00000900| 28 22 76 61 6c 75 65 20 | 31 20 3d 20 25 66 5c 6e |("value |1 = %f\n|
|00000910| 22 2c 76 61 6c 75 65 31 | 29 3b 20 7d 0a 20 20 20 |",value1|); }. |
|00000920| 20 76 69 72 74 75 61 6c | 20 76 6f 69 64 20 73 68 | virtual| void sh|
|00000930| 6f 77 74 77 6f 28 29 20 | 7b 20 7d 0a 7d 3b 0a 0a |owtwo() |{ }.};..|
|00000940| 63 6c 61 73 73 20 43 69 | 6e 68 65 72 65 74 65 64 |class Ci|nhereted|
|00000950| 63 6c 61 73 73 20 3a 20 | 70 75 62 6c 69 63 20 43 |class : |public C|
|00000960| 62 61 73 65 63 6c 61 73 | 73 20 7b 0a 20 20 70 72 |baseclas|s {. pr|
|00000970| 6f 74 65 63 74 65 64 3a | 0a 20 20 20 20 66 6c 6f |otected:|. flo|
|00000980| 61 74 20 76 61 6c 75 65 | 32 3b 0a 20 20 20 20 66 |at value|2;. f|
|00000990| 6c 6f 61 74 20 76 61 6c | 75 65 33 3b 0a 20 20 70 |loat val|ue3;. p|
|000009a0| 75 62 6c 69 63 3a 0a 20 | 20 20 20 43 69 6e 68 65 |ublic:. | Cinhe|
|000009b0| 72 65 74 65 64 63 6c 61 | 73 73 28 20 66 6c 6f 61 |retedcla|ss( floa|
|000009c0| 74 20 69 6e 70 75 74 31 | 2c 20 66 6c 6f 61 74 20 |t input1|, float |
|000009d0| 69 6e 70 75 74 32 20 29 | 20 3a 20 0a 20 20 20 20 |input2 )| : . |
|000009e0| 43 62 61 73 65 63 6c 61 | 73 73 28 69 6e 70 75 74 |Cbasecla|ss(input|
|000009f0| 31 29 20 7b 20 76 61 6c | 75 65 32 20 3d 20 69 6e |1) { val|ue2 = in|
|00000a00| 70 75 74 32 3b 20 7d 0a | 20 20 20 20 76 6f 69 64 |put2; }.| void|
|00000a10| 20 73 68 6f 77 74 77 6f | 28 29 20 7b 20 70 72 69 | showtwo|() { pri|
|00000a20| 6e 74 66 28 22 76 61 6c | 75 65 31 20 3d 20 25 66 |ntf("val|ue1 = %f|
|00000a30| 2c 20 76 61 6c 75 65 32 | 20 3d 20 25 66 5c 6e 22 |, value2| = %f\n"|
|00000a40| 2c 76 61 6c 75 65 31 2c | 76 61 6c 75 65 32 29 3b |,value1,|value2);|
|00000a50| 20 7d 0a 20 20 20 20 76 | 6f 69 64 20 73 65 74 76 | }. v|oid setv|
|00000a60| 61 6c 75 65 33 28 20 66 | 6c 6f 61 74 20 69 6e 70 |alue3( f|loat inp|
|00000a70| 75 74 20 29 20 7b 20 76 | 61 6c 75 65 33 20 3d 20 |ut ) { v|alue3 = |
|00000a80| 69 6e 70 75 74 3b 20 7d | 0a 20 20 20 20 66 6c 6f |input; }|. flo|
|00000a90| 61 74 20 67 65 74 76 61 | 6c 75 65 33 28 29 20 7b |at getva|lue3() {|
|00000aa0| 20 72 65 74 75 72 6e 20 | 76 61 6c 75 65 33 3b 20 | return |value3; |
|00000ab0| 7d 0a 7d 3b 0a 2f 2f 0a | 2f 2f 20 48 65 72 65 20 |}.};.//.|// Here |
|00000ac0| 66 6f 6c 6c 6f 77 73 20 | 74 68 65 20 6d 61 69 6e |follows |the main|
|00000ad0| 20 70 72 6f 67 72 61 6d | 0a 2f 2f 0a 6d 61 69 6e | program|.//.main|
|00000ae0| 28 29 20 0a 7b 0a 20 20 | 43 62 61 73 65 63 6c 61 |() .{. |Cbasecla|
|00000af0| 73 73 20 2a 61 72 72 61 | 79 5b 31 30 5d 3b 0a 20 |ss *arra|y[10];. |
|00000b00| 20 69 6e 74 20 6e 3d 30 | 3b 0a 20 20 2f 2f 0a 20 | int n=0|;. //. |
|00000b10| 20 2f 2f 20 74 68 69 73 | 20 77 6f 75 6c 64 20 62 | // this| would b|
|00000b20| 65 20 74 68 65 20 69 6e | 69 74 69 61 6c 69 7a 61 |e the in|itializa|
|00000b30| 74 69 6f 6e 20 70 61 72 | 74 0a 20 20 2f 2f 0a 20 |tion par|t. //. |
|00000b40| 20 61 72 72 61 79 5b 6e | 2b 2b 5d 20 3d 20 6e 65 | array[n|++] = ne|
|00000b50| 77 20 43 69 6e 68 65 72 | 65 74 65 64 63 6c 61 73 |w Cinher|etedclas|
|00000b60| 73 28 31 2c 32 29 3b 0a | 20 20 61 72 72 61 79 5b |s(1,2);.| array[|
|00000b70| 6e 2b 2b 5d 20 3d 20 6e | 65 77 20 43 69 6e 68 65 |n++] = n|ew Cinhe|
|00000b80| 72 65 74 65 64 63 6c 61 | 73 73 28 32 2c 33 29 3b |retedcla|ss(2,3);|
|00000b90| 0a 20 20 61 72 72 61 79 | 5b 6e 2b 2b 5d 20 3d 20 |. array|[n++] = |
|00000ba0| 6e 65 77 20 43 69 6e 68 | 65 72 65 74 65 64 63 6c |new Cinh|eretedcl|
|00000bb0| 61 73 73 28 33 2c 34 29 | 3b 0a 20 20 61 72 72 61 |ass(3,4)|;. arra|
|00000bc0| 79 5b 6e 2b 2b 5d 20 3d | 20 6e 65 77 20 43 69 6e |y[n++] =| new Cin|
|00000bd0| 68 65 72 65 74 65 64 63 | 6c 61 73 73 28 34 2c 35 |heretedc|lass(4,5|
|00000be0| 29 3b 0a 20 20 61 72 72 | 61 79 5b 6e 2b 2b 5d 20 |);. arr|ay[n++] |
|00000bf0| 3d 20 6e 65 77 20 43 69 | 6e 68 65 72 65 74 65 64 |= new Ci|nhereted|
|00000c00| 63 6c 61 73 73 28 35 2c | 36 29 3b 0a 20 20 2f 2f |class(5,|6);. //|
|00000c10| 0a 20 20 2f 2f 20 74 68 | 65 20 66 6f 6c 6c 6f 77 |. // th|e follow|
|00000c20| 69 6e 67 20 66 6f 72 20 | 6c 6f 6f 70 20 69 73 20 |ing for |loop is |
|00000c30| 74 68 65 20 70 61 72 74 | 20 77 68 65 72 65 20 61 |the part| where a|
|00000c40| 6c 6c 20 74 68 65 20 77 | 6f 72 6b 20 0a 20 20 2f |ll the w|ork . /|
|00000c50| 2f 20 69 73 20 64 6f 6e | 65 20 69 6e 20 61 20 70 |/ is don|e in a p|
|00000c60| 72 6f 67 72 61 6d 2e 20 | 75 6e 66 6f 72 74 75 6e |rogram. |unfortun|
|00000c70| 61 74 65 6c 79 20 74 68 | 65 72 65 20 69 73 20 6e |ately th|ere is n|
|00000c80| 6f 20 77 61 79 20 74 6f | 20 0a 20 20 2f 2f 20 61 |o way to| . // a|
|00000c90| 63 63 65 73 73 20 6d 65 | 74 68 6f 64 73 20 73 65 |ccess me|thods se|
|00000ca0| 74 76 61 6c 75 65 33 20 | 61 6e 64 20 73 68 6f 77 |tvalue3 |and show|
|00000cb0| 76 61 6c 75 65 33 20 61 | 74 20 74 68 69 73 20 70 |value3 a|t this p|
|00000cc0| 6f 69 6e 74 0a 20 20 2f | 2f 20 28 70 72 6f 76 69 |oint. /|/ (provi|
|00000cd0| 64 65 64 20 74 68 61 74 | 20 61 72 72 61 79 5b 69 |ded that| array[i|
|00000ce0| 5d 20 65 6c 65 6d 65 6e | 74 73 20 61 72 65 20 75 |] elemen|ts are u|
|00000cf0| 73 65 64 20 61 73 20 61 | 20 70 6f 69 6e 74 0a 20 |sed as a| point. |
|00000d00| 20 2f 2f 20 72 65 66 65 | 72 65 6e 63 65 29 20 0a | // refe|rence) .|
|00000d10| 20 20 2f 2f 0a 20 20 66 | 6f 72 20 28 69 6e 74 20 | //. f|or (int |
|00000d20| 69 3d 30 3b 20 69 3c 6e | 3b 20 69 2b 2b 29 20 7b |i=0; i<n|; i++) {|
|00000d30| 0a 20 20 20 20 2f 2f 0a | 20 20 20 20 2f 2f 20 6f |. //.| // o|
|00000d40| 66 20 63 6f 75 72 73 65 | 2c 20 74 68 65 20 6e 65 |f course|, the ne|
|00000d50| 78 74 20 73 74 61 74 65 | 6d 65 6e 74 20 77 6f 72 |xt state|ment wor|
|00000d60| 6b 73 20 66 69 6e 65 20 | 61 6e 64 20 77 65 20 64 |ks fine |and we d|
|00000d70| 6f 20 69 74 20 0a 20 20 | 20 20 2f 2f 20 61 6c 6c |o it . | // all|
|00000d80| 20 74 68 65 20 74 69 6d | 65 20 74 68 69 73 20 77 | the tim|e this w|
|00000d90| 61 79 3a 0a 20 20 20 20 | 2f 2f 0a 20 20 20 20 61 |ay:. |//. a|
|00000da0| 72 72 61 79 5b 69 5d 2d | 3e 73 68 6f 77 74 77 6f |rray[i]-|>showtwo|
|00000db0| 28 29 3b 0a 20 20 20 20 | 2f 2f 0a 20 20 20 20 2f |();. |//. /|
|00000dc0| 2f 20 62 75 74 20 63 6f | 6d 70 69 6c 65 20 74 68 |/ but co|mpile th|
|00000dd0| 65 20 66 6f 6c 6c 6f 77 | 69 6e 67 20 73 74 61 74 |e follow|ing stat|
|00000de0| 65 6d 65 6e 74 20 61 6e | 64 20 79 6f 75 27 6c 6c |ement an|d you'll|
|00000df0| 20 67 65 74 20 61 6e 20 | 65 72 72 6f 72 0a 20 20 | get an |error. |
|00000e00| 20 20 2f 2f 20 62 65 63 | 61 75 73 65 20 73 65 74 | // bec|ause set|
|00000e10| 76 61 6c 75 65 33 20 69 | 73 20 6e 6f 74 20 61 20 |value3 i|s not a |
|00000e20| 6d 65 6d 62 65 72 20 6f | 66 20 74 68 65 20 43 62 |member o|f the Cb|
|00000e30| 61 73 65 63 6c 61 73 73 | 0a 20 20 20 20 2f 2f 0a |aseclass|. //.|
|00000e40| 20 20 20 20 61 72 72 61 | 79 5b 69 5d 2d 3e 73 65 | arra|y[i]->se|
|00000e50| 74 76 61 6c 75 65 33 28 | 66 6c 6f 61 74 28 69 29 |tvalue3(|float(i)|
|00000e60| 29 3b 0a 20 20 20 20 2f | 2f 0a 20 20 20 20 2f 2f |);. /|/. //|
|00000e70| 20 61 6e 64 20 61 6c 73 | 6f 20 74 68 65 20 66 6f | and als|o the fo|
|00000e80| 6c 6c 6f 77 69 6e 67 20 | 74 68 72 65 65 20 73 74 |llowing |three st|
|00000e90| 61 74 65 6d 65 6e 74 73 | 20 77 69 6c 6c 20 63 61 |atements| will ca|
|00000ea0| 75 73 65 20 61 20 63 72 | 75 73 68 69 6e 67 20 0a |use a cr|ushing .|
|00000eb0| 20 20 20 20 2f 2f 20 68 | 61 6c 74 20 64 75 72 69 | // h|alt duri|
|00000ec0| 6e 67 20 63 6f 6d 70 69 | 6c 61 74 69 6f 6e 20 73 |ng compi|lation s|
|00000ed0| 69 6e 63 65 20 74 68 65 | 72 65 20 69 73 20 6e 6f |ince the|re is no|
|00000ee0| 20 73 74 61 6e 64 61 72 | 64 20 63 6f 6e 76 65 72 | standar|d conver|
|00000ef0| 73 69 6f 6e 0a 20 20 20 | 20 2f 2f 20 6b 6e 6f 77 |sion. | // know|
|00000f00| 6e 20 62 65 74 77 65 65 | 6e 20 69 6e 68 65 72 65 |n betwee|n inhere|
|00000f10| 74 65 64 20 63 6c 61 73 | 73 65 73 20 61 6e 64 20 |ted clas|ses and |
|00000f20| 74 68 65 20 62 61 73 65 | 20 63 6c 61 73 73 2e 0a |the base| class..|
|00000f30| 20 20 20 20 2f 2f 0a 20 | 20 20 20 43 69 6e 68 65 | //. | Cinhe|
|00000f40| 72 65 74 65 64 63 6c 61 | 73 73 20 2a 64 75 6d 6d |retedcla|ss *dumm|
|00000f50| 79 3b 0a 20 20 20 20 64 | 75 6d 6d 79 20 3d 20 61 |y;. d|ummy = a|
|00000f60| 72 72 61 79 5b 69 5d 3b | 20 0a 20 20 20 20 64 75 |rray[i];| . du|
|00000f70| 6d 6d 79 2d 3e 73 65 74 | 76 61 6c 75 65 33 28 66 |mmy->set|value3(f|
|00000f80| 6c 6f 61 74 28 69 29 29 | 3b 0a 20 20 7d 0a 7d 0a |loat(i))|;. }.}.|
|00000f90| 0a 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |.-------|--------|
|00000fa0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000fb0| 2d 2d 31 35 32 37 32 32 | 36 30 34 38 31 39 38 38 |--152722|60481988|
|00000fc0| 31 2d 2d 0a | |1--. | |
+--------+-------------------------+-------------------------+--------+--------+